home *** CD-ROM | disk | FTP | other *** search
- Path: wintermute.ecs.fullerton.edu!titan!grosin
- From: grosin@titan (Gil Rosin)
- Newsgroups: comp.lang.c++
- Subject: Linking C++ with ASM Class members -- HOW??
- Date: 19 Apr 1996 01:14:07 GMT
- Organization: California State University at Fullerton
- Message-ID: <4l6pcv$q4r@wintermute.ecs.fullerton.edu>
- NNTP-Posting-Host: titan.ecs.fullerton.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Hi, I am writing a program in C++ using Borland C++ v3.1.
-
- First of all, let me start the question off right, lets say I have a program
- that is a general user utility. It is a graphical program where I do my own
- low level graphics. What is common/good practice to handle graphics primitives?
-
- 1) Make a "graphics" class with all the low level graphics primatives and in
- each "drawItem()" function, declare an instance of the "graphics" class and
- draw the items using the members through the graphics class.
-
- OR
-
- 2) Make graphics primatives members of all "Item" classes.
-
- OR
-
- 3) Don't make graphics primatives members of any class and just leave them
- globally accessible.
-
- Before you make your descision, let me clarify what I'm doing :). I have a
- "kit" that gives several controls. Each control has a member function that
- draws it on the screen. The member function that draws it on the screen in
- turn has to call low level graphics functions that I have written in
- assembler such as DrawCircle(), DrawLine(), DrawPixel() etc, etc.
-
- Now, what is the common way to handle the primatives from the above 3 choices?
- I personally think #1. It has the class protection, but doesn't take up as
- much memory as the other 2. #2 is a memory hog, to have instances of every
- graphics primative in every instance of a control class? Didn't seem good
- to me. #3 seems just as good as #1, but doesn't have class protection.
-
- Is there a way to make a graphics class that is only accessible from the
- control class, but not a new instance?
-
- Also, the following question is aimed more towards people who know how to do
- this with borland C++.
-
- If I have the following class:
-
- class Test
- {
- public:
- void Func(int, int, char);
- };
-
- If void Func is implemented in ASM, I HAVE to call this function:
-
- proc @Test@Func$qiinc far
-
- endp
-
- The $qiinc is I have discovered the parameter list of the function. This is
- apperently how borland C++ calls ALL functions in C++.
-
- I don't really have the complete manual set any more, but from what I do have
- I couldnt find anything on how to get this parameter list. Can some one post
- a table maybe?
-
- The way I am doing it now is having a test program that calls a function
- with the same exact parameters, getting assembly output and seeing what the
- parameter list is in the ASM output.
-
- It would be much easier if I had a table. I have unlocked the mystery of a few
- types, but it gets a bit nasty with a lot of non numeric types and pointers,
- if not, (I don't really expect a BC++ user to read this, what are the chances
- of that? <g>) I can just use the ASM output.
-
- Anyways, any info/input on any of this email, please reply via
- email to grosin@titan.fullerton.edu.
-
- Thanks.
-
-
-